package com.jueban.Dto;

import com.jueban.model.ApplyInfo;
import com.jueban.model.ApplyOfIP;
import com.jueban.model.State;
import com.jueban.model.Suggest;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.beans.BeanUtils;

import javax.validation.Valid;
import javax.validation.constraints.Pattern;


@Data
public class ApplyOfIPDto {

    private String finallyIPName;//最终专利名称

    @Valid
    private ApplyInfoDto applyInfo;//申请表资料(见知识产权申请表)


    private String informationPath;//申请材料路径(doc文件)

    private String proxyFormPath;//代理通知书路径(pdf文件)

    private Suggest departmentSuggest;//部门意见

    private Suggest researchSuggest;//学术委员会意见(一般为null)

    private Suggest academicSuggest;//科研处意见

    public void transferData(ApplyOfIP applyOfIP) {
        BeanUtils.copyProperties(this, applyOfIP);
        applyOfIP.setState(new State());
        ApplyInfo applyInfo = new ApplyInfo();
        this.getApplyInfo().transferData(applyInfo);
        applyOfIP.setApplyInfo(applyInfo);
    }
}
